layui.use(['element','table','laytpl','layer'],function () {
    var $ = layui.$,
        table = layui.table,
        layer = layui.layer;
    var tableIns = table.render({
        elem: '#demo'
        ,id:"mytable"
        ,url: '/transefer/in/list' //数据接口
        ,page: true //开启分页
        ,limit:15
        ,limits:[15,30,60,100]
        ,response: {
            statusName: 'code' //数据状态的字段名称，默认：code
            ,statusCode: 200 //成功的状态码，默认：0
            ,msgName: 'msg' //状态信息的字段名称，默认：msg
            ,countName: 'total' //数据总数的字段名称，默认：count
            ,dataName: 'rows' //数据列表的字段名称，默认：data
        }
        ,cols: [[ //表头
            {title: '序号',type:'numbers'}
            ,{field: 'elderlyName', title: '老人姓名'}
            ,{field: 'elderlyIdNo', title: '身份证号码'}
            ,{field: 'fromName', title: '原机构'}
            ,{ title: '申请时间',templet:function(d){
                    return $.dateFormat(new Date(d.createdTime),"yyyy-MM-dd");
                }
            }
            ,{ title: '状态',templet:function(d){
                    return d.status == 1 ? '待审批' : (d.status == 2 ? '已转档': '被拒绝');
                }
            }
            ,{field: 'msg', title: '拒绝原因'}
        ]]
    });
});